Integrand size = 25, antiderivative size = 103 \[ \int \frac {(a+b \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=-\frac {b (b c-2 a d) x}{d^2}+\frac {c (b c-a d)^2 x}{d^2 \left (c^2+d^2\right )}-\frac {b^2 \log (\cos (e+f x))}{d f}+\frac {(b c-a d)^2 \log (c \cos (e+f x)+d \sin (e+f x))}{d \left (c^2+d^2\right ) f} \]
[Out]
Time = 0.13 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3622, 3556, 3565, 3611} \[ \int \frac {(a+b \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {(b c-a d)^2 \log (c \cos (e+f x)+d \sin (e+f x))}{d f \left (c^2+d^2\right )}+\frac {c x (b c-a d)^2}{d^2 \left (c^2+d^2\right )}-\frac {b x (b c-2 a d)}{d^2}-\frac {b^2 \log (\cos (e+f x))}{d f} \]
[In]
[Out]
Rule 3556
Rule 3565
Rule 3611
Rule 3622
Rubi steps \begin{align*} \text {integral}& = -\frac {b (b c-2 a d) x}{d^2}+\frac {b^2 \int \tan (e+f x) \, dx}{d}+\frac {(b c-a d)^2 \int \frac {1}{c+d \tan (e+f x)} \, dx}{d^2} \\ & = -\frac {b (b c-2 a d) x}{d^2}+\frac {c (b c-a d)^2 x}{d^2 \left (c^2+d^2\right )}-\frac {b^2 \log (\cos (e+f x))}{d f}+\frac {(b c-a d)^2 \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{d \left (c^2+d^2\right )} \\ & = -\frac {b (b c-2 a d) x}{d^2}+\frac {c (b c-a d)^2 x}{d^2 \left (c^2+d^2\right )}-\frac {b^2 \log (\cos (e+f x))}{d f}+\frac {(b c-a d)^2 \log (c \cos (e+f x)+d \sin (e+f x))}{d \left (c^2+d^2\right ) f} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.17 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.05 \[ \int \frac {(a+b \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {\frac {(a+i b)^2 \log (i-\tan (e+f x))}{i c-d}-\frac {(a-i b)^2 \log (i+\tan (e+f x))}{i c+d}+\frac {2 (b c-a d)^2 \log (c+d \tan (e+f x))}{d \left (c^2+d^2\right )}}{2 f} \]
[In]
[Out]
Time = 0.30 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.14
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (-a^{2} d +2 a b c +b^{2} d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{2} c +2 a b d -b^{2} c \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right ) d}}{f}\) | \(117\) |
default | \(\frac {\frac {\frac {\left (-a^{2} d +2 a b c +b^{2} d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{2} c +2 a b d -b^{2} c \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right ) d}}{f}\) | \(117\) |
norman | \(\frac {\left (a^{2} c +2 a b d -b^{2} c \right ) x}{c^{2}+d^{2}}+\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right ) d f}-\frac {\left (a^{2} d -2 a b c -b^{2} d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (c^{2}+d^{2}\right )}\) | \(120\) |
parallelrisch | \(-\frac {-2 x \,a^{2} c d f -4 x a b \,d^{2} f +2 x \,b^{2} c d f +\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} d^{2}-2 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a b c d -\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) b^{2} d^{2}-2 \ln \left (c +d \tan \left (f x +e \right )\right ) a^{2} d^{2}+4 \ln \left (c +d \tan \left (f x +e \right )\right ) a b c d -2 \ln \left (c +d \tan \left (f x +e \right )\right ) b^{2} c^{2}}{2 \left (c^{2}+d^{2}\right ) d f}\) | \(155\) |
risch | \(\frac {2 i x a b}{i d -c}-\frac {a^{2} x}{i d -c}+\frac {x \,b^{2}}{i d -c}-\frac {2 i d \,a^{2} x}{c^{2}+d^{2}}-\frac {2 i d \,a^{2} e}{\left (c^{2}+d^{2}\right ) f}+\frac {4 i a b c x}{c^{2}+d^{2}}+\frac {4 i a b c e}{\left (c^{2}+d^{2}\right ) f}-\frac {2 i b^{2} c^{2} x}{\left (c^{2}+d^{2}\right ) d}-\frac {2 i b^{2} c^{2} e}{\left (c^{2}+d^{2}\right ) d f}+\frac {2 i b^{2} x}{d}+\frac {2 i b^{2} e}{d f}+\frac {d \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a^{2}}{\left (c^{2}+d^{2}\right ) f}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a b c}{\left (c^{2}+d^{2}\right ) f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) b^{2} c^{2}}{\left (c^{2}+d^{2}\right ) d f}-\frac {b^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{d f}\) | \(357\) |
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.29 \[ \int \frac {(a+b \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {2 \, {\left (2 \, a b d^{2} + {\left (a^{2} - b^{2}\right )} c d\right )} f x + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left (b^{2} c^{2} + b^{2} d^{2}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (c^{2} d + d^{3}\right )} f} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.60 (sec) , antiderivative size = 1025, normalized size of antiderivative = 9.95 \[ \int \frac {(a+b \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\text {Too large to display} \]
[In]
[Out]
none
Time = 0.32 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.19 \[ \int \frac {(a+b \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {\frac {2 \, {\left (2 \, a b d + {\left (a^{2} - b^{2}\right )} c\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} + \frac {2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} d + d^{3}} + \frac {{\left (2 \, a b c - {\left (a^{2} - b^{2}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}}}{2 \, f} \]
[In]
[Out]
none
Time = 0.43 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.19 \[ \int \frac {(a+b \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {\frac {2 \, {\left (a^{2} c - b^{2} c + 2 \, a b d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} + \frac {{\left (2 \, a b c - a^{2} d + b^{2} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}} + \frac {2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{2} d + d^{3}}}{2 \, f} \]
[In]
[Out]
Time = 7.32 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.12 \[ \int \frac {(a+b \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-a^2\,1{}\mathrm {i}+2\,a\,b+b^2\,1{}\mathrm {i}\right )}{2\,f\,\left (c+d\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-a^2+a\,b\,2{}\mathrm {i}+b^2\right )}{2\,f\,\left (d+c\,1{}\mathrm {i}\right )}+\frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,{\left (a\,d-b\,c\right )}^2}{d\,f\,\left (c^2+d^2\right )} \]
[In]
[Out]